<?php
class Zfb_Acl_Model_Privleges extends Zfb_DbTable
{
	const NAME = 'a_privleges';
	public function getPrivlegeRules()
	{
		$sql = $this->getAdpater()
					->select()
					->from($this->_name)
					->joinLeft(
						Zfb_Acl_Model_Resources::NAME, 
						self::NAME. '.resource_id = ' . Zfb_Acl_Model_Resources::NAME . '.id',
						array('module','controller', 'action')
					)
					->joinLeft(
						Zfb_Acl_Model_Role::NAME, 
						self::NAME. '.role_id = ' . Zfb_Acl_Model_Role::NAME . '.id',
						array('name')
					);
		return $this->getAdapter()->fetchAll($sql);
	}
}